Skip to content

Add 'Full text options' fulfillment link.#409

Merged
jazairi merged 1 commit into
mainfrom
use-614
Jun 18, 2026
Merged

Add 'Full text options' fulfillment link.#409
jazairi merged 1 commit into
mainfrom
use-614

Conversation

@jazairi

@jazairi jazairi commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Why these changes are being introduced:

UXWS has requested for journal records with
Browzine links should also include a 'Full-text
options' button that links to the full record.

Relevant ticket(s):

How this addresses that need:

This adds the 'Full-text options' link.

Side effects of this change:

None.

Developer

Accessibility
  • ANDI or WAVE has been run in accordance to our guide.
  • This PR contains no changes to the view layer.
  • New issues flagged by ANDI or WAVE have been resolved.
  • New issues flagged by ANDI or WAVE have been ticketed (link in the Pull Request details above).
  • No new accessibility issues have been flagged.
New ENV
  • All new ENV is documented in README.
  • All new ENV has been added to Heroku Pipeline, Staging and Prod.
  • ENV has not changed.
Approval beyond code review
  • UXWS/stakeholder approval has been confirmed.
  • UXWS/stakeholder review will be completed retroactively.
  • UXWS/stakeholder review is not needed.
Additional context needed to review

E.g., if the PR includes updated dependencies and/or data
migration, or how to confirm the feature is working.

Code Reviewer

Code
  • I have confirmed that the code works as intended.
  • Any CodeClimate issues have been fixed or confirmed as
    added technical debt.
Documentation
  • The commit message is clear and follows our guidelines
    (not just this pull request message).
  • The documentation has been updated or is unnecessary.
  • New dependencies are appropriate or there were no changes.
Testing
  • There are appropriate tests covering any new functionality.
  • No additional test coverage is required.

Comment thread app/views/thirdiron/browzine.html.erb Fixed
@coveralls

coveralls commented Jun 17, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 27786832619

Coverage decreased (-0.05%) to 98.353%

Details

  • Coverage decreased (-0.05%) from the base build.
  • Patch coverage: 1 uncovered change across 1 file (14 of 15 lines covered, 93.33%).
  • No coverage regressions found.

Uncovered Changes

File Changed Covered %
app/controllers/thirdiron_controller.rb 12 11 91.67%
Total (2 files) 15 14 93.33%

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 1518
Covered Lines: 1493
Line Coverage: 98.35%
Coverage Strength: 71.23 hits per line

💛 - Coveralls

@mitlib mitlib temporarily deployed to timdex-ui-pi-use-614-rhngmz9bt June 17, 2026 21:13 Inactive

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new “Full-text options” link to the ThirdIron/BrowZine fulfillment UI so that journal results with BrowZine data can also offer a path back to the source “full record” page.

Changes:

  • Pass a full_record_url through the BrowZine content-loader request so the BrowZine partial can render a “Full-text options” link.
  • Adjust BrowZine/LibKey link CSS class usage (tests now assert .libkey-link rather than .button in some cases).
  • Add a controller test covering the BrowZine route when full_record_url is provided.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
app/controllers/thirdiron_controller.rb Plumbs full_record_url from request params into the BrowZine view.
app/views/search/_result_primo.html.erb Extracts the Primo “full record” link and passes it toward the BrowZine trigger.
app/views/search/_trigger_browzine.html.erb Appends full_record_url to the BrowZine loader URL.
app/views/thirdiron/browzine.html.erb Renders the new “Full-text options” link alongside the BrowZine link.
app/views/thirdiron/libkey.html.erb Adjusts BrowZine link CSS classes used in the LibKey-rendered HTML.
test/controllers/thirdiron_controller_test.rb Updates selectors for LibKey HTML and adds a BrowZine + full_record_url test.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread app/controllers/thirdiron_controller.rb
Comment thread app/views/thirdiron/browzine.html.erb Outdated
Comment thread test/controllers/thirdiron_controller_test.rb
@qltysh

qltysh Bot commented Jun 17, 2026

Copy link
Copy Markdown

2 new issues

Tool Category Rule Count
qlty Structure Function with many returns (count = 5): safe_full_record_url 1
qlty Structure Function with high complexity (count = 6): safe_full_record_url 1


parsed.to_s
rescue URI::InvalidURIError
nil

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function with high complexity (count = 5): safe_full_record_url [qlty:function-complexity]

@jazairi jazairi temporarily deployed to timdex-ui-pi-use-614-rhngmz9bt June 17, 2026 21:17 Inactive
@jazairi jazairi requested a review from Copilot June 17, 2026 21:23
@jazairi jazairi temporarily deployed to timdex-ui-pi-use-614-rhngmz9bt June 17, 2026 21:23 Inactive

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Comment thread app/controllers/thirdiron_controller.rb

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Comment thread app/views/search/_trigger_browzine.html.erb Outdated
Comment thread app/controllers/thirdiron_controller.rb
Comment thread test/controllers/thirdiron_controller_test.rb
@jazairi jazairi requested a review from Copilot June 17, 2026 21:53
@jazairi jazairi temporarily deployed to timdex-ui-pi-use-614-rhngmz9bt June 17, 2026 21:53 Inactive

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

app/views/search/_trigger_browzine.html.erb:9

  • data-content-loader-url-value is currently unquoted. With the new full_record_url query param this attribute value now includes & and multiple = characters, which can lead to invalid HTML and fragile parsing. Quoting the attribute value makes the markup valid and robust.
<% data_url = "/browzine?#{query_params.to_query}" %>

<span class="libkey-container"
     data-controller="content-loader"
     data-content-loader-url-value=<%= data_url %>>

Comment thread app/controllers/thirdiron_controller.rb
@jazairi jazairi requested a review from Copilot June 17, 2026 22:12
@jazairi jazairi temporarily deployed to timdex-ui-pi-use-614-rhngmz9bt June 17, 2026 22:12 Inactive

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.

@JPrevost JPrevost self-assigned this Jun 18, 2026

@JPrevost JPrevost left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works as I understand it should, but please checkin with Dave as to whether the button class should be removed and whether the full text link should be in the lib key-actions div.

If you can figure out the different conditions the two browzine link templates come into play some inline comments would be amazing for future us :)

Comment thread app/views/thirdiron/browzine.html.erb
Comment thread app/views/search/_result_primo.html.erb Outdated
<%= link_to 'Full-text options', @full_record_url, class: 'button libkey-link', data: { matomo_seen: "Results, Full-text Options Link Seen, Tab: {{getActiveTabName}}", matomo_click: "Results, Full-text Options Link Engaged, Link: {{getElementText}}", content_piece: 'Full-text options' } %>
<% end %>

<div class="libkey-actions">

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure the intent of this libkey-actions div and whether this full text options link belongs inside or outside of it. I know it isn't libkey related, but it's possible that div was named as such as a means to group the links coming out of this partial when the only links were libkey. It may be worth checking in with Dave to confirm if he has input into whether this new link is in that div or not.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moving the link outside of this div was a styling workaround, similar to removing the button class. When the Full-text options link is placed inside the div, both it and the Browse journal link render as if they are the first link in the list.

I'll tag Dave on this to see if he has insight on this and the button class issue.

<% if @libkey[:browzine_link].present? %>
<div class="libkey-actions">
<%= link_to @libkey[:browzine_link][:text], @libkey[:browzine_link][:link], class: 'button libkey-link', data: { matomo_seen: "Results, Browzine Link Seen, Tab: {{getActiveTabName}}", matomo_click: "Results, Browzine Link Engaged, Link: {{getElementText}}", content_piece: @libkey[:browzine_link][:text] } %>
<%= link_to @libkey[:browzine_link][:text], @libkey[:browzine_link][:link], class: 'libkey-link', data: { matomo_seen: "Results, Browzine Link Seen, Tab: {{getActiveTabName}}", matomo_click: "Results, Browzine Link Engaged, Link: {{getElementText}}", content_piece: @libkey[:browzine_link][:text] } %>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why button is being removed? Don't we add it to all the fulfillment links and the css styles them as buttons or not conditionally?

It's unclear to me when this template comes into play versus the same link in the browzine template. I'm concerned whatever condition this is here for should include the new full text options as well?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does, but the addition of the Full text options link affects the conditional styling in such a way that Browse journal renders as a primary button rather than the intended underlined styling. The easiest path I could figure to fix that was to remove the button class, but that doesn't necessarily mean it's the best path.

<% end %>

<div class="libkey-actions">
<%= link_to @browzine[:browzine_link][:text], @browzine[:browzine_link][:link], class: 'libkey-link', data: { matomo_seen: "Results, Browzine Link Seen, Tab: {{getActiveTabName}}", matomo_click: "Results, Browzine Link Engaged, Link: {{getElementText}}", content_piece: @browzine[:browzine_link][:text] } %>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why button is being removed? Don't we add it to all the fulfillment links and the css styles them as buttons or not conditionally?

@jazairi jazairi temporarily deployed to timdex-ui-pi-use-614-rhngmz9bt June 18, 2026 17:21 Inactive
@jazairi

jazairi commented Jun 18, 2026

Copy link
Copy Markdown
Contributor Author

@djanelle-mit Could I get your eyes on this PR? Adding the 'Full-text options' link has had some unintentional effects on styling:

  1. Browzine links render as primary buttons, unless the button class is removed.
  2. If the 'Full-text options' link is placed inside the libkey-links div, both it and the Browzine link render as secondary buttons.

I was trying not to mess with the CSS, hence these HTML workarounds. However, I'm curious whether you think this would be worth adjusting the CSS to accommodate the new links.

Let me know if I can clarify anything. Thanks!

@jazairi jazairi requested a review from djanelle-mit June 18, 2026 17:26

@djanelle-mit djanelle-mit left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I took a look at the build and adjusting the markup here doesn't seem to have any ill effects on the output. I couldn't find any examples of more than one button or broken styling on the deployment.

I think this is good to go if it was solving visual bugs you ran into with the CSS. We can always refactor the CSS after all these rounds of link PRs land, too... that logic seems to be holding for now, but happy to adjust if need be.

Not sure if I'm the only remaining approver here, but consider it approved from my end. I can adjust this if need be.

@jazairi jazairi requested a review from JPrevost June 18, 2026 18:08
@jazairi jazairi temporarily deployed to timdex-ui-pi-use-614-rhngmz9bt June 18, 2026 19:27 Inactive
@jazairi

jazairi commented Jun 18, 2026

Copy link
Copy Markdown
Contributor Author

@JPrevost Sorry, I forgot to add the suggested comments before tagging for re-review. Could you let me know if they match your understanding?

Why these changes are being introduced:

UXWS has requested for journal records with
Browzine links should also include a 'Full-text
options' button that links to the full record.

Relevant ticket(s):

- [USE-614](https://mitlibraries.atlassian.net/browse/USE-614)

How this addresses that need:

This adds the 'Full-text options' link.

Side effects of this change:

- Button class has been removed from certain
LibKey links for styling purposes.
- New link is rendered outside of libkey-links
div for styling purposes.
- Added comments clarifying the Browzine/LibKey
partials.
@jazairi jazairi temporarily deployed to timdex-ui-pi-use-614-rhngmz9bt June 18, 2026 20:19 Inactive
@jazairi jazairi merged commit 4eeafa0 into main Jun 18, 2026
5 of 6 checks passed
@jazairi jazairi deleted the use-614 branch June 18, 2026 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants